package com.neu.wangweili.dao;

import com.neu.commons.Dao.BaseDao;
import com.neu.commons.Utils.Cover;
import com.neu.commons.Utils.GenerateSqlDao;

import java.util.HashMap;
import java.util.Map;

public class StuBatchDao extends BatchBaseDao {
    public int[] deleteStu(String[]stu_id){
        int[] row=null;
        String sql="delete from t_stu_info"+
                " where stu_id=?";



        row=super.stuBatchDelete(sql,stu_id);
        return row;
    }
//    批量任免学生会
    public int[] appointStu(String stu_statis,String[]stu_id){
        int[] row=null;
        String sql="update t_stu_info"+
                " set stu_statis=?"+
                " where stu_id=?";
        row=super.stuBatchAppiont(sql,stu_statis,stu_id);
        return row;
    }

    public int Allupdate(String[] key) {
        int row=0;
        String sql=" update t_approve"
                +" set status=1"
               +" where appro_id in (";
        for (int i = 0; i <key.length ; i++) {
            sql+="?,";
        }
        String sq=sql.substring(0,sql.lastIndexOf(","));
        String s=sq+")";
        BaseDao d=new BaseDao();
        row=d.BaseDaoUpdate(s,key);
        System.out.println(row);
        return row;
    }

    public int AllRUT(String[] k) {
        int row=0;
        String sql=" update t_approve"
                +" set status=2"
                +" where appro_id in (";
        for (int i = 0; i <k.length ; i++) {
            sql+="?,";
        }
        String sq=sql.substring(0,sql.lastIndexOf(","));
        String s=sq+")";
        BaseDao d=new BaseDao();
        row=d.BaseDaoUpdate(s,k);
        System.out.println(row);
        return row;
    }
}
